package com.diligreat.action; 

import java.util.List;

import com.diligreat.action.base.BaseAction;
import com.diligreat.domain.Selection;
import com.diligreat.service.SelectionService;
import com.opensymphony.xwork2.ModelDriven;

/**  
 * @Author Bruce 
 * @Date 2012-11-5
 * @Comments
 */
public class SelectionAction extends BaseAction implements ModelDriven<Selection>{
	private static final long serialVersionUID = 1L;
	private Selection selection = new Selection();
	private List<Selection> selectionList;
	private SelectionService selectionService;
	
	
	public String input(){
		selectionList = selectionService.listAll();
		return INPUT;
	}
	public String addSubmit(){
		selectionService.addSelection(selection);
		return "goInput";
	}
	public String list(){
		selectionList = selectionService.listAll();
		return SUCCESS;
	}
	public String update(){
		
		return SUCCESS;
	}
	public String updateSubmit(){
		selectionService.update(selection);
		return "goInput";
	}
	public String del(){
		selectionService.delete(selection.getId());
		return "goInput";
	}
	
	//============ get and set ===============
	public void setSelectionService(SelectionService selectionService) {
		this.selectionService = selectionService;
	}
	public List<Selection> getSelectionList() {
		return selectionList;
	}
	@Override
	public Selection getModel() {
		return selection;
	}
	
	
	
	
}
 